package com.sun.stringescapeutils;

import okhttp3.*;

import java.io.IOException;

public class BlogLoginTest {
    public static void main(String[] args) throws IOException {
        String url = "http://localhost:8888/login";
        MediaType JSON = MediaType.get("application/json;charset=utf-8");

        OkHttpClient client = new OkHttpClient();
        Request request = new Request.Builder()
                .url(url)
                .post(RequestBody.create("{\"account\":\"admin\",\"password\":\"admin\"}",JSON))
                .build();

        Response response = client.newCall(request).execute();
        String result = response.body().string();
        System.out.println(result);

    }

}
